package commonDataStructures;

import java.util.ArrayList;

public class PStack<E> implements PrimitiveCollection<E>{
	private ArrayList<E> _stack;
	
	
	public void init(){
		_stack.clear();
	}
	public PStack(){
		_stack = new ArrayList<E>();
	}

	@Override
	public void insert(E e) {
		_stack.add(0, e);
		
	}

	@Override
	public boolean isEmpty() {
		return _stack.isEmpty();
	}

	@Override
	public E remove() {
		return _stack.remove(0);
	}

	@Override
	public int size() {
		return _stack.size();
	}
}
